package cn.kooki.app.duobao.util.manager;

import android.content.Context;
import android.provider.ContactsContract;

import java.util.ArrayList;

import cn.kooki.app.duobao.data.Bean.User.ContactInfo;
import cn.kooki.app.duobao.util.ContactHandler;

import android.provider.ContactsContract.CommonDataKinds.Phone;

/**
 * Created by xiong on 2016/1/7.
 */
public class ContactUtils {

    public interface ContactCallback {
        void onQueryCompelete(ArrayList<ContactInfo> infos);
    }

    public static void getContacts(Context context, ContactCallback callback) {
        ContactHandler contactHandler = new ContactHandler(context.getContentResolver(), callback);
        contactHandler.startQuery(0, null, Phone.CONTENT_URI, new String[]{Phone.NUMBER, Phone.DISPLAY_NAME}, null, null, null);
    }


}
